export default{
  install(Vue, options) {
    Vue.prototype.checkTel = (rule, value, callback) => {
      let val = value.toString().trim()
      console.log(val.length !== 11,!Number.isInteger(value),!/^1[3|4|5|7|8]\d{9}$/.test(val));
      if (val.length !== 11 || !Number.isInteger(value) || !/^1[3|4|5|7|8]\d{9}$/.test(val)) {
        callback(new Error('手机格式不对'))
      } else {
        console.log('checkTel ok');
        callback()
      }
    },
    Vue.prototype.setTit = (val) => {
      document.title = val;
      setTimeout(function(){window.scrollTo(0,1)}, 0)
      // window.addEventListener("load", function() { setTimeout(function(){console.log('2333');window.scrollTo(0,1)}, 0); }, false);
    }
  }
}
